<%@ page language="java" import="java.util.*,com.entity.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
  
    <title>My JSP 'zhuye.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <style type="text/css">
      #div1{
        border:1px; width:100px; 
        vertical-align:buttom ;
        text-align:rigth; 
        background-image:url(images/portal_icon.png) ; 
        background-repeat:no-repeat; 
        margin-left:50px;
        padding-lfet:50px;
        position:absolute;
      }
A:link{color: #000000; TEXT-DECORATION: none;}
A:visited {COLOR: #000000; TEXT-DECORATION: none}
A:active {COLOR: #3333ff; TEXT-DECORATION: none}
A:hover {COLOR: #ff0000; TEXT-DECORATION: none;}
    </style>
  </head>
  
  <body bgcolor="#70A4CF">
<fieldset  style="width: 90%;padding-left: 5%; margin-left: 5%;" >
   <legend style="color:#FFFFFF; font-size:18px; font-weight:200;">部门选择</legend>
    <div style=" margin-left:5%;">
       <%
          List list = (List)request.getAttribute("list"); 
          Iterator it = list.iterator();
          int i=0;
          while(it.hasNext()){
          Zd zd = (Zd)it.next();
         %>
         <!-- djxs:递进显示 -->
         <!-- djxs.do?state=showxian&id=<%//=zd.getId() %> -->
	      <a href="javascript:void(0);" onclick="showxian(<%=zd.getId() %>)" target="mainFrame" style=" width: 18%;">
	      <img src="images/portal_icon.png" width=65px height=55px border="0"><%=zd.getTypename() %></a>
	   <%i++; 
	   if(i%5==0){%>
	   <br><%}
	    } %>
	    </div>
</fieldset>
<fieldset  style="width: 90%;padding-left: 5%;margin-left: 5%;" >
   <legend style="color:#FFFFFF; font-size:18px; font-weight:200;">查询</legend>
  <!--  <div style="border:1px; margin-left:10%; width:80px; height:80px; vertical-align:buttom ;text-align:rigth;  background-image:url(images/sousuo.gif) ; background-repeat:no-repeat;" ></div> -->
  <div style=" margin-left:5%;">
   <a href="searchList.do?state=showlist&cs=s&sname=" target="mainFrame">
   <img src="images/sousuo.gif" border="0" width=55px height=55px>省级高级查询</a>
   </div>
</fieldset>
<fieldset  style="width: 90%;padding-left: 5%;margin-left: 5%;" >
   <legend style="color:#FFFFFF; font-size:18px; font-weight:200;">统计</legend>
   <!-- <div style="border:1px; margin-left:10%; width:80px; height:80px; vertical-align:buttom ;text-align:rigth;  background-image:url(images/tj1.jpg); background-position:center ; background-repeat:no-repeat;" ></div> -->
   <div style=" margin-left:5%;">
   <a href="tjcx.jsp?sname=" target="_parent">
   <img src="images/tj1.jpg" width=80px border="0" height=80px>省级统计查询</a>
   </div>
</fieldset>
</body>
<script type="text/javascript">

 var xmlHttp;
 //函数GetXmlHttpObject() - 创建XMLHttpRequest对象,即创建一个异步调用对象
		function GetXmlHttpObject()
		{
			var xmlHttp=null;
			try
			 {
				 // Firefox, Opera 8.0+, Safari
				 xmlHttp=new XMLHttpRequest();
			 }
			catch (e)
			 {
				 try {
				 	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
				  }catch (e)
				  {
				  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				  }
			 }
			return xmlHttp;
		}
function showxian(id){
 		xmlHttp=GetXmlHttpObject();        //调用GetXmlHttpObject()函数，创建XMLHttpRequest对象
			if (xmlHttp==null)                //如果创建失败，则
			 {
				 alert ("Browser does not support HTTP Request");
				 return;
			 }
			var url="djxs.do?state=checkshi";
			var para="&&id="+id;               //定义url , 其主要读取数据库
			url=url+para+"&sid="+Math.random();   //Math对象的random方法，取随机数
			xmlHttp.onreadystatechange=stateChanged ;//设置当XMLHttpRequest对象xmlHttp状态改变时调用的函数,注意函数名后不要添加小括号
			xmlHttp.open("post",url,true);    //使用XMLHttpRequest对象的open()方法 , 创建HTTP请求
			xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			xmlHttp.send(para);  
 }
 function stateChanged() 
		{ 
			//判断XMLHttpRequest对象的readyState属性值是否为4,如果为4表示异步调用完成(注意:异步调用完成 不代表 异步调用成功)
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 { 
			//如果异步调用成功 --> XMLHttpRequest对象的status属性值为200 , html文件在本地运行,则xmlHttp.status的返回值为0,故应该加上xmlHttp.status==0
			 if(xmlHttp.status==200 || xmlHttp.status==0)
			     {
			       if((xmlHttp.responseText.split(","))[0]!=null&&(xmlHttp.responseText.split(","))[0]!=""&&(xmlHttp.responseText.split(","))[0]!=0)
			       {
			          location.href="djxs.do?state=showxian&id="+(xmlHttp.responseText.split(","))[1];
			       }
			       else{
			          alert("对不起，该地区暂时没有数据");
			          }
			     }
			  }
	  }
</script>
</html>
